package com.hoelg.hgc.DAO;


public class HGCUser {

	private int uid;

	private String login;

	private double balance;

	public int getUid() {
		return uid;
	}

	public void setUid(int uid) {
		this.uid = uid;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public HGCUser(int uid, String login, double balance, String shaoneizedpwd) {
		super();
		this.uid = uid;
		this.login = login;
		this.balance = balance;
		this.shaoneizedpwd = shaoneizedpwd;
	}

	private static HGCUser user;
	public static HGCUser getInstance(){
		if (null == user){
			user = new HGCUser();
		}
		return user;
	}
	public static void setInstance(int uid, String login, double balance, String shaoneizedpwd){
		getInstance();
		user = new HGCUser(uid, login, balance, shaoneizedpwd);
	}

	public static void dispose(){
		if (null != user){
			user.balance = 0.0D;
			user.login = "";
			user.shaoneizedpwd = "";
			user.uid = 0;
			user = null;
		}
	}
	
	public HGCUser() {
		super();
		this.balance = 0.0D;
		this.login = "";
		this.shaoneizedpwd = "";
		this.uid = 0;
	}

	public String ConfirmConnection() {
		return "connected as ("+uid+") " + login + " !";
	}
	
	private String shaoneizedpwd;

	public String getShaoneizedpwd() {
		return shaoneizedpwd;
	}

	public void setShaoneizedpwd(String shaoneizedpwd) {
		this.shaoneizedpwd = shaoneizedpwd;
	}
	
}
